<%
  #File:    /app/views/pages/_document_categories.rhtml
  #Author:  Andrew Stone
  #Created: 09.14.2006
%>
<% 
  i = 0
  @document_categories.each do |dc|
    if dc.document.length > 0  
      cls = "right_col"
      cls = "left_col" if ( i % 2 == 0) 
      i += 1

%>
      <div class="<%=cls%>">
        <%=start_small_module_wrapper%>
          <div class="module_header">
            <div class="module_header_left">
              <%=h(dc.title)%>
            </div>
            <div class="module_header_right">
              <%=secure_link_to("Edit",ca("/manage/documents","manage_files",dc.id))%>
            </div>
          </div>
          <div class="small_module">
          <% 
            if dc.description %> 
              <p><%=dc.description%></p> <br/>
          <% 
            end 
            dc.document.each do |doc| %>
              <%=secure_document_link(doc)%>
          <%
            end %>
          </div>
        <%=end_module_wrapper%>
        <div class="module_spacer">&nbsp;</div>
      </div>
<% 
    end
  end %>
